package com.mvc.controller;

import com.mvc.pojo.Dept;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

@Controller
public class DeptController {
    @ResponseBody
    @RequestMapping("/hello")
    public String hello() {
        return "dept/list";
    }

    @ResponseBody
    @PostMapping("/dept")
    public Dept getDept() {
        Dept dept = new Dept();
        dept.setDeptno(1);
        dept.setDname("开发部");
        dept.setLoc("北京");
        return dept;
    }
}
